﻿using System;

namespace EOffice.Common
{
	public class DTOParserFactory
    {	
		internal static DTOParser GetParser(Type dtoType)
        {
			// GetParser
			switch (dtoType.Name)
        	{
		    							                	            
                case "FeedBackDto":
                	return new DTOParserFeedBack();                			            									
		    							                	            
                case "FileDto":
                	return new DTOParserFile();                			            									
		    							                	            
                case "FileFolderDto":
                	return new DTOParserFileFolder();                			            									
		    							                	            
                case "FolderDto":
                	return new DTOParserFolder();                			            									
		    							                	            
                case "GroupUserDto":
                	return new DTOParserGroupUser();                			            									
		    							                	            
                case "HolidayDto":
                	return new DTOParserHoliday();                			            									
		    							                	            
                case "NewsDto":
                	return new DTOParserNews();                			            									
		    							                	            
                case "NoticeDto":
                	return new DTOParserNotice();                			            									
		    							                	            
                case "PermissionDto":
                	return new DTOParserPermission();                			            									
		    							                	            
                case "ShareFileDto":
                	return new DTOParserShareFile();                			            									
		    							                	            
                case "ShareNoticeDto":
                	return new DTOParserShareNotice();                			            									
		    							                	            
                case "TaskDto":
                	return new DTOParserTask();                			            									
		    							                	            
                case "UserDto":
                	return new DTOParserUser();                			            									
		

			}
			// if we reach this point then we failed to find a matching type. Throw
            // an exception.
            throw new Exception("Unknown Type");			
		}
	}
}
